package com.example.testgraphiceffect;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.DashPathEffect;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PathDashPathEffect;
import android.view.View;

public class MyView extends View{
	
	
	Paint mPaint = new Paint();
	Path icon = new Path();
	public MyView (Context context){
		super (context);

		icon.lineTo(0, 0);
		icon.lineTo(-5, 5);
		icon.lineTo(0, 5);
		icon.lineTo(5, 0);
		icon.lineTo(0, -5);
		icon.lineTo(-5, -5);
	}
	
	protected void onDraw (Canvas canvas){
		
		super.onDraw(canvas);
		
		
		canvas.drawColor(Color.WHITE);
		mPaint.setTextSize(50);
		mPaint.setStyle(Paint.Style.STROKE);
		mPaint.setStrokeWidth(10);
		
		float[] intervals = {20,5,30,5};
		DashPathEffect effect = new DashPathEffect(intervals, 0);
		PathDashPathEffect effect2 = new PathDashPathEffect(icon, 20, 0, PathDashPathEffect.Style.MORPH);
		
		
		mPaint.setPathEffect(effect);
		mPaint.setPathEffect(effect2);
		canvas.drawCircle(150, 150, 100, mPaint);
	}

}
